import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_app/BaseMaterialWidget.dart';

class DecoratedBoxDemo extends BaseMaterialWidget {
  @override
  Widget buildContent(BuildContext context) {
    return Center(
        child: Column(
      children: <Widget>[
        Container(
          margin: EdgeInsets.only(top: 20),
          width: 100,
          height: 100,
          decoration: BoxDecoration(
              color: Colors.grey,
              image: DecorationImage(
                  image: ExactAssetImage('images/lake.jpg'), fit: BoxFit.cover),
              borderRadius: BorderRadius.circular(15),
              boxShadow: <BoxShadow>[
                BoxShadow(
                    color: Colors.grey,
                    blurRadius: 15.0,
                    spreadRadius: 5.0,
                    offset: Offset(0, 5))
              ]),
        ),
        Container(
          width: 150,
          height: 150,
          margin: EdgeInsets.only(top: 20),
          decoration: BoxDecoration(
              gradient: LinearGradient(
                  begin: FractionalOffset(0.5, 0.0),
                  end: FractionalOffset(0.5, 1.0),
                  colors: <Color>[Colors.red, Colors.green])),
        ),
        Container(
          width: 150,
          height: 150,
          margin: EdgeInsets.only(top: 20),
          decoration: BoxDecoration(
              gradient: RadialGradient(
                  center: Alignment.center,
                  colors: <Color>[
                Colors.red,
                Colors.green,
                Colors.blue,
                Colors.deepPurple
              ])),
        )
      ],
    ));
  }

  @override
  String getTitle() {
    return "装饰盒子";
  }
}
